<?php
namespace App\Library\System\Model;

use App\Library\System\Model;

/**
 * Skill Model
 *
 * @category   Model
 * @package    App\Library\System\Model
 * @author     Tin Nguyen <tinntt@peslook.com>
 * @copyright  Peslook
 * @version    1.0
 * @since      Class available since Release 1.0
 */
class CategoryModel extends Model
{
    /**
     * Constructor
     *
     * @param string $id
     */
    public function __construct($id)
    {
        parent::__construct();
        $this->id = $id;
    }

    public function getAllSkill()
    {
        return $this->more($this->select()
                ->from('skill')
                ->where(array(
                    'category' => $this->id
                ))
        );
    }

    public function getCategoryName()
    {
        return $this->one($this->select()
                ->from('skill')
                ->where(array(
                    'category' => $this->id
                ))
        )->categoryname;

    }
}